/*
 * @Author: 89-83-77
 * @Description: 请填写当前文件简介
 * @Date: 2025-03-27 23:49:24
 * @LastEditTime: 2025-03-27 23:49:35
 * @FilePath: \event-analysis-systemd:\Desktop\client\src\utils\validate.js
 */

export function isExternal(path) {//判断是否是外部链接
  return /^(https?:|mailto:|tel:)/.test(path);
}

export function pathResolve(basePath, path) {//路径解析函数
  if (isExternal(path)) return path;
  if (isExternal(basePath)) return basePath;
  return basePath ? `${basePath}/${path}` : path;
}
